/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */






function applyFilter()
{var v;
    if (Flag_Search_Panel_Status=="BIO")
         v=document.getElementById("divsearchfilter_bio").getElementsByTagName('INPUT');
    else if (Flag_Search_Panel_Status=="NONBIO")
         v=document.getElementById("divsearchfilter_nonbio").getElementsByTagName('INPUT');
 
    var strlocations="";
    var strtags="";
    var strdepths="";
    var strunits="";
    var strcontributors="";
    var strFromDate="";
    var strToDate="";

    for (i=0;i<v.length;i++)
        {
            if (v[i].type.toUpperCase()=='CHECKBOX' && v[i].name=="chklocationfilter")
                {
                    if (v[i].checked)
                        {
                            if (strlocations!="")
                            {
                                strlocations=strlocations+","
                            }
                            strlocations=strlocations+v[i].id;

                        }
                 }
            if (v[i].type.toUpperCase()=='CHECKBOX' && v[i].name=="chktagsfilter")
                {
                    if (v[i].checked)
                        {
                            if (strtags!="")
                            {
                                strtags=strtags+","
                            }
                            strtags=strtags+"'"+v[i].value+"'";

                        }
                 }
            if (v[i].type.toUpperCase()=='CHECKBOX' && v[i].name=="chkdepthsfilter")
                {
                    if (v[i].checked)
                        {
                            if (strdepths!="")
                            {
                                strdepths=strdepths+","
                            }
                            strdepths=strdepths+v[i].value;

                        }
                 }
            if (v[i].type.toUpperCase()=='CHECKBOX' && v[i].name=="chkunitsfilter")
                {
                    if (v[i].checked)
                        {
                            if (strunits!="")
                            {
                                strunits=strunits+","
                            }
                            strunits=strunits+v[i].id;

                        }
                 }
            if (v[i].type.toUpperCase()=='CHECKBOX' && v[i].name=="chkcontributorsfilter")
                {
                    if (v[i].checked)
                        {
                            if (strcontributors!="")
                            {
                                strcontributors=strcontributors+","
                            }
                            strcontributors=strcontributors+v[i].id;

                        }
                 }
            if (v[i].type.toUpperCase()=='TEXT' && v[i].name=="fromdate")
                {

                            strFromDate=$.datepicker.formatDate('yy/mm/dd', new Date(v[i].value));
                           
                    
                 }
            if (v[i].type.toUpperCase()=='TEXT' && v[i].name=="todate")
                {

                            strToDate=$.datepicker.formatDate('yy/mm/dd', new Date(v[i].value));

                 }


        }

if (strlocations!="")strlocations= "&locationfilter="+strlocations;
if (strtags!="")strtags= "&tagsfilter="+strtags;
if (strdepths!="")strdepths= "&depthsfilter="+strdepths;
if (strunits!="")strunits= "&unitsfilter="+strunits;
if (strcontributors!="")strcontributors= "&contributorsfilter="+strcontributors;
if (strFromDate!="")strFromDate= "&startdatefilter="+strFromDate;
if (strToDate!="")strToDate= "&enddatefilter="+strToDate;
return strlocations+strtags+strdepths+strunits+strcontributors+strFromDate+strToDate;
        
}

function reloadsearchaction()
{
    if (Flag_Search_Panel_Status=="BIO")
        searchaction("chkbio",false);
    else if (Flag_Search_Panel_Status=="NONBIO")
        searchaction("chknonbio",false);
    else if (Flag_Search_Panel_Status=="OVERLAY")
        searchaction("chkoverlay",false);
}